package com.atguigu.lease.web.api.controller;

import com.atguigu.lease.common.result.Result;
import com.atguigu.lease.model.base.BaseSearchDto;
import com.atguigu.lease.web.api.service.BrowsingHistoryService;
import com.atguigu.lease.web.api.vo.HistoryItemVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app/history")
@Tag(name = "浏览器记录模块")
public class HistoryController {
    @Resource
    BrowsingHistoryService browsingHistoryService;
    ///app/history/pageItem?current=1&size=10
    @GetMapping("pageItem")
    @Operation(summary = "分页查询浏览器记录")
    public Result<Page<HistoryItemVo>> pageItem(BaseSearchDto searchDto){
        return Result.ok(browsingHistoryService.pageItem(searchDto));
    }
}
